-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Winsock.h was included multiple times through windows.h causing compile errors #772
Conversation
Hi @antihax , Visual Studio 2019 works for me out of the box, like 2017 and 2015 did before. What configuration are you using by any chance ? If it is something esoteric like Mingw32 or MSYS2 I'm no even sure it is supported anymore. Anyway, some remarks about the PR:
|
Interesting, I am using VS2019. Are you defining |
I'm not playing with low-level settings like that, because it is irrelevant with CMake. I just generate the adequate VS solution with CMake following the steps and settings of the Wiki. For any other config variant you are on your own, and we are not going to dedicate any time to support such variants, sorry. |
Unfortunately I also did the same, but CMake output will not build due to redefining winsock.h imports. I will see if I can identify if I did something incorrect when generating the project from CMake. |
I use a recent CMake, like 3.15+. (3.16 at that moment). Try to delete the CMake cache (see CMake GUI) and start again from the begining. |
I checked I have the latest versions of all components, latest Win10 SDK, and completely reset all MSVC 2019 settings. Problem persists on all imports of windows.h. I create a quick test solution with nothing else and can successfully import windows.h with no issue. Not sure what in CubicSDR or a dependency is creating the conflict, but something is importing winsock out of order. I've refactored to include WIN32_LEAN_AND_MEAN in the pre-processor options, which is a cleaner solution. |
Great, works for me too ! Please re-add |
@antihax Thanks for your contribution(s) ! |
Added
#define _WINSOCKAPI_
to prevent windows.h importing winsock.h and removed a few redundant windows.h imports.